package edu.jkd.controller;

import edu.jkd.entity.Product;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.servlet.ModelAndView;

import java.math.BigDecimal;

/**
 *
 */
@Controller
@RequestMapping("/seat")
public class SeatController {
    /**前往选座界面
     * @return
     */
    @GetMapping("/{proId}/{proName}/{proPrice}")
    public ModelAndView toSeatSelect(@PathVariable("proId") Integer proId,
                                     @PathVariable("proName") String proName,
                                     @PathVariable("proPrice") BigDecimal proPrice
                                     ){
       ModelAndView mov=new ModelAndView();

        Product product = new Product();
        product.setProId(proId);
        product.setProPrice(proPrice);
        product.setProName(proName);



       mov.addObject("product",product);
       mov.setViewName("seatSelect");

       return mov;
   }
}
